{include file="indexTop" /}
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">

            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a href="/column/all/" class="layui-this">综合</a>
                    <span class="fly-mid"></span>
                    <a href="/column/all/unsolved/">未结</a>
                    <span class="fly-mid"></span>
                    <a href="/column/all/solved/">已结</a>
                    <span class="fly-mid"></span>
                    <a href="/column/all/wonderful/">精华</a>
                </div>

                <!-- 帖子 -->
                <ul class="fly-list">
                    <?php foreach ($data as $key => $data): ?>
                    <?php $data['ctime']=ftime($data['ctime']); ?>
                    <li>
                        <a href="" class="fly-avatar">
                            <img src="__root__{:$data['avatar']}" alt="{:$data['username']}"> </a>
                        <h2>
                            <a class="layui-badge">{:$data['cname']}</a>
                            <a href="{:url('index/Read/index',['pid'=>$data['pid']])}">{:$data['title']}</a>
                        </h2>
                        <div class="fly-list-info">
                            <a href="/u/168" link>
                                <cite>{:$data['username']}</cite>
                                <?php if ($data['is_approve']): ?>
                                <i class="iconfont icon-renzheng" title="认证信息：root"></i>
                                <?php endif ?>
                            </a>
                            <span>{:$data['ctime']} </span>
                            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                <i class="iconfont icon-kiss"></i> 20</span>
                            <!-- 已结/未结 -->
                            <?php if ($data['status']=='1'): ?>
                            <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
                            <?php endif ?>
                            <span class="fly-list-nums">
                                <i class="iconfont icon-pinglun1" title="回答"></i> {:$data['answer_num']} </span>
                        </div>
                        <div class="fly-list-badge"> </div>
                    </li>
                    <?php endforeach ?>
                </ul>
                <!-- 分页 -->
                


                <div style="text-align: center">
                    <div class="laypage-main">
                        <a href="/column/all/page/2/" class="laypage-next">更多求解</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">



            <!-- 本周热议 -->
            <dl class="fly-panel fly-list-one">
                <dt class="fly-panel-title">本周热议</dt>
                <?php foreach ($hotPost as $row): ?>
                <dd>
                    <a href="{:url('index/read/index',['pid'=>$row['pid']])}">{$row['title']}</a>
                    <span>
                        <i class="iconfont icon-pinglun1"></i> {$row['answer_num']}</span>
                </dd>
                <?php endforeach ?>

            </dl>


        </div>
    </div>
</div>




<script type="text/javascript">

    layui.use(['jquery', 'layer'], function () {
        $ = layui.jquery;
        layer = layui.layer;

        $('#LAY_signin').click(function () {
            $.ajax({
                url: '{:url('index/Sign/sign')}',
                type: 'GET',
                dataType: 'json',
            })
                .done(function (res) {
                    if (res.error == 1) {
                        layer.msg(res.info, { icon: 5 }, function () {
                        });
                    } else {
                        layer.msg(res.info, { icon: 6 }, function () {
                            location.href = res.url;
                        });
                    }
                })
                .fail(function () {
                    console.log("error");
                });


        })
        $('#LAY_signinTop').click(function () {

            layer.open({
                type: 2,
                title: '签到活跃榜 - TOP 20',
                shadeClose: true,
                shade: 0.8,
                area: ['310px', '60%'],
                content: '{:url('index/sign/signlist')}' //iframe的url
        });



        })



    })





</script>